# -*- coding: utf-8 -*-
from core.serializers import CustomModelSerializer
from core.relations import BaseNameWritableRelatedField, UserNameWritableRelatedField
from .models import TestDesign
from rest_framework import serializers


class ListTestDesignSerializer(CustomModelSerializer):
    """
    测试设计列表-序列化器
    """

    product = BaseNameWritableRelatedField()

    class Meta:
        model = TestDesign
        fields = "__all__"
        read_only_fields = ["id"]


class TestDesignSerializer(CustomModelSerializer):
    """
    测试设计详情-序列化器
    """

    product = BaseNameWritableRelatedField()

    class Meta:
        model = TestDesign
        fields = "__all__"
        read_only_fields = ["id"]
